package com.Manager;

import com.example.pokemon_integrado.DrawBattle;
import com.example.pokemon_integrado.DrawCredits;
import com.example.pokemon_integrado.DrawInitialize;
import com.example.pokemon_integrado.DrawMenu;
import com.example.pokemon_integrado.DrawSobre;
import com.example.pokemon_integrado.FadeIn;
import com.example.pokemon_integrado.FadeOut;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.Log;

public class DrawManager {

	private static DrawManager dManager;
	
	public FadeIn fIN;
	public FadeOut fOUT;
	public DrawBattle battleD;
	public DrawInitialize initD;
	public DrawMenu menuD;
	public DrawCredits creditsD;
	public DrawSobre sobreD;
		
	public static DrawManager getInstance(Context c)
	{
		if(dManager == null)
			dManager = new DrawManager(c);
		return dManager;
	}
	
	private DrawManager(Context context)
	{
		this.fIN = new FadeIn(context);
		this.fOUT = new FadeOut(context);
		this.battleD = new DrawBattle(context);		
		this.initD = new DrawInitialize(context);
		this.menuD = new DrawMenu(context);
		this.creditsD = new DrawCredits(context);
		this.sobreD = new DrawSobre(context);
	}
	
	public void Draw(Canvas canvas, int W, int H, Paint p)
	{
		switch (SceneManager.getInstance().currentScene) 
		{
			case 0:	
				//this.fOUT.Draw(canvas, W, H, p);
				this.initD.Draw(canvas, W, H, p);
				break;
			case 1:
				this.menuD.Draw(canvas, W, H, p);
				break;
			case 2:				
				break;
			case 3:
				//this.fOUT.Draw(canvas, W, H, p);
				this.battleD.Draw(canvas, W, H, p);
				break;
			case 4:
				this.creditsD.Draw(canvas, W, H, p);
				break;
			case 5:
				this.sobreD.Draw(canvas, W, H, p);
				break;
			case 6:
				break;
		}		
	}
	
	public void getTouch(float x, float y)
	{
		switch (SceneManager.getInstance().currentScene) 
		{
			case 1:
				this.menuD.getTouch(x, y);
			break;
		}
		Log.e("", "ID :"+SceneManager.getInstance().currentScene);
	}
}
